package com.cogent.business.helper;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import com.cogent.business.session.SessionUtil;

public class SessionHelper {	
	public static String getNoteMsg(HttpServletRequest request) {
		HttpSession session = request.getSession();
		Object obj = session.getAttribute("notemsg");
		session.removeAttribute("notemsg");
		if(obj == null)
			return "";
		else
			return obj.toString();		
	}
	
	public static String getValueByKey(HttpServletRequest request, String key) {
		HttpSession session = request.getSession();
		Object obj = session.getAttribute(key);
		if(obj == null)
			return "";
		else
			return obj.toString();
	}
	
	public static Object getReuestMsg(HttpServletRequest request, String key) {
		return SessionUtil.getReuestMsg(request, key);
	}
	
	public static String getNoteMsg(HttpServletRequest request, String formName) {
		return SessionUtil.getNoteMsg(request, formName);
	}
}
